package cn.boyu.service.impl;

import cn.boyu.entity.SysDictType;
import cn.boyu.mapper.SysDictTypeMapper;
import cn.boyu.query.DictTypeQuery;
import cn.boyu.service.ISysDictTypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yn
 * @since 2022-11-22
 */
@Service
public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService {

    @Override
    public Page<SysDictType> queryPage(DictTypeQuery qo) {
        QueryWrapper<SysDictType> qw =new QueryWrapper<>();
        qw.eq(qo.getDictId()!=null,"dict_id",qo.getDictId());
        Page<SysDictType> page=new Page<>();
        page.setCurrent(qo.getCurrentPage());
        page.setSize(qo.getPageSize());
        return page(page,qw);
    }
}
